﻿<Configuration:UnityConfigurationContainer x:Class="Common.Unity.Extensions.Serialization.Testing.Configuration"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Configuration="clr-namespace:Common.Unity.Configuration;assembly=Common.Unity"
    xmlns:Testing="clr-namespace:Common.Unity.Extensions.Serialization.Testing"
    xmlns:ExtensionConfiguration="clr-namespace:Common.Unity.Extensions.Configuration;assembly=Common.Unity.Extensions.Configuration"
    xmlns:Unity="clr-namespace:Common.Unity;assembly=Common.Unity"
    xmlns:Serialization="clr-namespace:Common.Unity.Extensions.Serialization;assembly=Common.Unity.Extensions.Serialization"
    xmlns:Properties="clr-namespace:Common.Unity.Extensions.Serialization.Testing.Properties"
    xmlns:Objects="clr-namespace:Common.Unity.Testing.Objects;assembly=Common.Unity.Testing"
    xmlns:CoreSerialization="clr-namespace:Common.Core.Serialization;assembly=Common.Core"
	x:TypeArguments="Testing:Configuration"
    >
	<Configuration:UnityContainer x:Key="DefaultContainer">
		<Configuration:UnityType Type="{x:Type Unity:IObjectCreationPolicy}" MapTo="{x:Type Serialization:XmlSerializationPolicy}">
			<Configuration:InjectionConstructor>
				<Configuration:DependencyValue Type="{x:Type CoreSerialization:IStreamResolver}" />
			</Configuration:InjectionConstructor>
		</Configuration:UnityType>
		
		<Configuration:UnityType Type="{x:Type Unity:IObjectCreationPolicy}" MapTo="{x:Type Serialization:XmlSerializationPolicy}" BuildName="AssemblyResourceBased">
			<Configuration:InjectionConstructor>
				<Configuration:DependencyValue Type="{x:Type CoreSerialization:IStreamResolver}" BuildName="AssemblyResourceBased" />
			</Configuration:InjectionConstructor>
		</Configuration:UnityType>
		
		<Configuration:UnityType Type="{x:Type Unity:IObjectCreationPolicy}" MapTo="{x:Type Serialization:XmlSerializationPolicy}" BuildName="TypeResourceBased">
			<Configuration:InjectionConstructor>
				<Configuration:DependencyValue Type="{x:Type CoreSerialization:IStreamResolver}" BuildName="TypeResourceBased" />
			</Configuration:InjectionConstructor>
		</Configuration:UnityType>
		
		<Configuration:UnityType Type="{x:Type CoreSerialization:IStreamResolver}" MapTo="{x:Type CoreSerialization:FileStreamResolver}">
			<Configuration:InjectionConstructor>
				<Configuration:InstanceValue Instance="NamedObjectFile.xml" />
			</Configuration:InjectionConstructor>
		</Configuration:UnityType>
		
		<Configuration:UnityType Type="{x:Type CoreSerialization:IStreamResolver}" MapTo="{x:Type CoreSerialization:AssemblyStreamResolver}" BuildName="AssemblyResourceBased">
			<Configuration:InjectionConstructor>
				<Configuration:InstanceValue Instance="Common.Unity.Extensions.Serialization.Testing" />
				<Configuration:InstanceValue Instance="Common.Unity.Extensions.Serialization.Testing.Resources.NamedObjectAssembly.xml" />
			</Configuration:InjectionConstructor>
		</Configuration:UnityType>
		
		<Configuration:UnityType Type="{x:Type CoreSerialization:IStreamResolver}" MapTo="{x:Type CoreSerialization:TypeResourceStreamResolver}" BuildName="TypeResourceBased">
			<Configuration:InjectionConstructor>
				<Configuration:InstanceValue Instance="{x:Type Properties:Resources}" />
				<Configuration:InstanceValue Instance="NamedObjectType" />
			</Configuration:InjectionConstructor>
		</Configuration:UnityType>
		
		<Configuration:UnityType Type="{x:Type Objects:INamedObject}" MapTo="{x:Type Objects:NamedObject}" BuildName="FileBased">
			<ExtensionConfiguration:PolicyReference Type="{x:Type Unity:IObjectCreationPolicy}" BuildType="{x:Type Serialization:XmlSerializationPolicy}" />
		</Configuration:UnityType>

		<Configuration:UnityType Type="{x:Type Objects:INamedObject}" MapTo="{x:Type Objects:NamedObject}" BuildName="AssemblyResourceBased">
			<ExtensionConfiguration:PolicyReference Type="{x:Type Unity:IObjectCreationPolicy}" BuildType="{x:Type Serialization:XmlSerializationPolicy}" BuildName="AssemblyResourceBased" />
		</Configuration:UnityType>

		<Configuration:UnityType Type="{x:Type Objects:INamedObject}" MapTo="{x:Type Objects:NamedObject}" BuildName="TypeResourceBased">
			<ExtensionConfiguration:PolicyReference Type="{x:Type Unity:IObjectCreationPolicy}" BuildType="{x:Type Serialization:XmlSerializationPolicy}" BuildName="TypeResourceBased" />
		</Configuration:UnityType>

		<Configuration:UnityContainer.Extensions>
			<Unity:CommonExtension />
			<ExtensionConfiguration:ConfigurationExtension />
		</Configuration:UnityContainer.Extensions>
	</Configuration:UnityContainer>
</Configuration:UnityConfigurationContainer>
